package com.geor.gcv.ict.train;

import java.util.List;
import java.util.Map;

import org.opencv.core.Mat;

/**
 * svm训练数据实现类
 * 
 * @author geor.lusongnan
 *
 */
public class TrainerSVMGraphic extends TrainerAbstract {
	Ml ml = new MlSVM();

	@Override
	public void train(Mat trainData, Mat label, String out) {
		log.info("training ....");
		ml.train(trainData, label, out);
		log.info("over :" + out);
	}

	@Override
	public void train(Map<String, List<Mat>> maps, String out) {
		species = getMatSize(maps);
		Mat mats[] = createTrainDataAndLabel(maps);
		// 开始训练
		train(mats[0], mats[1], out);
	}
}
